home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 1 / ETO Development Tools 1.iso / Tools - Objects / MacApp / MacApp 2.0 CD Release / MacApp 2.0 (Many Libraries) / Interfaces / CIncludes / UDebug.h < prev    next >
Encoding:
C/C++ Source or Header  |  1990-03-27  |  6.2 KB  |  137 lines  |  [TEXT/MPS ]

  1. /*[a-,body+,h-,o=100,r+,rec+,t=4,u+,#+,j=20/57/1$,n-]*/
  2. /* UDebug.p */
  3. /* Copyright © 1985-1990 by Apple Computer, Inc.  All rights reserved. */
  4. #ifndef  __UDebug__
  5. #define __UDebug__  0
  6. #endif
  7. #if  ! __UDebug__
  8. #define __UDebug__  1
  9.  
  10.         /* • Auto-Include the requirements for this unit's interface. */
  11. #ifndef  __UMacAppUtilities__
  12. #include "UMacAppUtilities.h"
  13. #endif
  14.  
  15. const short kMaxFlags            = 20;                    /* maximum flags that can be remembered by
  16.                                                          the debugger */
  17. const short kMaxSyms            = 20;
  18.    /* maximum symbols remembered by the debugger
  19.                                                          */
  20.  
  21. typedef enum {forceOn, forceOff, forceUnchanged} DebugForceOptions;
  22.             /* Used with DebugForceOptions procedure. */
  23.  
  24. extern pascal Boolean gMastReport;                        /* When TRUE, report changes in # master
  25.                                                          pointers. */
  26. extern pascal long gMaxStackDepth;                        /* Maximum stack space used to date in the
  27.                                                          program. This is computed every
  28.                                                          %_BP/%_EP/%_EX. */
  29. extern pascal Str255 gReportInfo;                        /* If gReportNext and gReportInfo <>'' then
  30.                                                          display the text of gReportInfo on next
  31.                                                          %_BP or %_EP, then clear the buffer. */
  32. extern pascal Boolean gReportNext;
  33.    /* If set to TRUE, report pending information
  34.                                                          (e.g., gReportInfo) at the very next %_BP
  35.                                                          or %_EP. */
  36. extern pascal Boolean gReportTime;
  37.    /* if TRUE, report TickCount during tracing */
  38. extern pascal Boolean gSingleStep;                        /* if TRUE, break into debugger at next
  39.                                                          opportunity */
  40. extern pascal Boolean gTracing;                            /* TRUE when the debugger is tracing. Set
  41.                                                          this using TrcEnable function. */
  42.  
  43. extern pascal Boolean DebugCanReadLn(void);
  44.         /* Returns True if you can ReadLn to the user. This in turn is true when there is a debu
  45.            g view
  46.         (pDebugView), that view can currently write to its window, and this unit is initialized. */
  47.  
  48. extern pascal Boolean DebugCanWriteLn(void);
  49.         /* Returns true if you can WriteLn to the user in the debug window. This is true if there
  50.         exists a debug view and this unit is initialized. */
  51.  
  52. extern pascal void GetCallersMethodName(StringPtr s);
  53.         /* Return the name of the calling method in s. */
  54.  
  55. extern pascal void GetMethodName(long ppc, StringPtr s);
  56.         /* Returns in s the name of the method or procedure into which address ppc points. Calls
  57.         GetProcName to do the work. */
  58.  
  59. extern pascal void GetProcName(long ppc, StringPtr className, StringPtr procName);
  60.         /* Returns in procName the name of the method, procedure, or function into which address ppc
  61.         points. If it is a method, the method's class is returned in className. If not a method,
  62.  
  63.         className is set to ''. */
  64.  
  65. extern pascal void ShowMemory(long startAddress, long numBytes);
  66.         /* Dump memory to Transcript from startaddress for numBytes */
  67.  
  68. extern pascal void IDUDebug(void);
  69.         /* Prints in the debug window the compile date and time of this unit. */
  70.  
  71. extern pascal Boolean TrcEnable(Boolean okToTrace);
  72.         /* When a WriteLn call is made, the captureregistered through this function is called wi
  73.            th the
  74.         sequence */
  75.  
  76. #if  qPerform
  77.  
  78. extern pascal Boolean DebugPerfMonitor(Boolean turnOn);
  79.         /* When a WriteLn call is made, the captureregistered through this function is called wi
  80.            th the
  81.         sequence */
  82. #endif
  83. #if  qDebug
  84.  
  85. extern pascal Ptr DebugCapture(Ptr captureProc);
  86.         /* When a WriteLn call is made, the captureproc registered through this function is called
  87.         with the sequence:
  88.         captureProc(textBuf: Ptr; byteCount: INTEGER);
  89.         The return value is the address of the previous captureProc. The debug view's AddText method
  90.         is called immediately after the captureProc.*/
  91.  
  92. extern pascal OSErr DebugRedirect(short vRefnum, StringPtr fileName);
  93.         /* Returns number of characters per line in current transcript window. */
  94.  
  95. extern pascal short DebugTranscriptWidth(void);
  96.         /* Returns number of characters per line in current transcript window. */
  97.  
  98. extern pascal void EnterMacAppDebugger(void);
  99.         /* Invokes the debugger. Called by ProgramBreak in UFailure. */
  100.  
  101. extern pascal void DebugEndForce(void);
  102.         /* Calls the EndForce method of the debug view (see UTranscriptView.) */
  103.  
  104. extern pascal void DebugFlag(BooleanPtr flagAddr, short flagChar, Ptr theActionProc, StringPtr 
  105.    flagDesc);
  106.         /* Register a BOOLEAN flag for the X debugger command; flagAddr should be the address of the
  107.         flag; theActionshould be a procPtr for a to be called to change the flag (optional - may be
  108.         NIL).flagChar should be the character to use in the debugger to toggle the flag; desc
  109.         should be a short description of the flag.No checking is done for duplicate flagChars. */
  110.  
  111. extern pascal void DebugForceOutput(DebugForceOptions DebugToWindow, DebugForceOptions DebugToFile);
  112.         /* Calls the ForceOutput method of the debug view (see UTranscriptView.) */
  113.  
  114. extern pascal void DebugGlobalHandle(Ptr globAddr, Ptr theActionProc, StringPtr *globSym);
  115.         /* Register a symbol name of a global variable that contains a handle; case does not matter.
  116.         The global variable should contain a Handle.The Action is a Function to be called to derive
  117.         the handle if necessary. Symbolic handles registered in this way may be entered in response
  118.         to the F and I commands of the debugger. */
  119.  
  120. extern pascal void DebugShowTranscriptWindow(void);
  121.         /* Opens the debug transcript window. */
  122.  
  123. extern pascal void DebugTerminate(void);
  124.         /* Called to initialize the UDebug unit. */
  125.  
  126. extern pascal void InitUDebug(Handle segTable, Handle nonRes, Ptr enterProc, Ptr inspectProc, Ptr 
  127.    symbolProc);
  128.  
  129. extern pascal void InitUDebugAfterIApplication(void);
  130.         /* Call this once at the end of IApplication to finish initialization of the debugger.
  131.         Installs the debug window in the event handler chain and installs a print handler in the
  132.         debug view. */
  133.  
  134. #endif
  135. #endif
  136.  
  137.